Focus detection apparatus detecting fears to a plurality of areas

ABSTRACT

Focus detecting apparatus detecting focus to a plurality of areas has (1) a first auto-focusing mode in which, regardless of an in-focus or out-of-focus state, an auto-focusing operation (including focus detection and driving of an optical system) are repeatedly performed, and (2) a second auto-focusing mode in which the auto-focusing operation is performed until an in-focus state is obtained and the auto-focusing operation is terminated after the in-focus state is detected. A sensor unit is provided for receiving light beams from a plurality of different areas in a photographic scene. A focus processing circuit is provided for, in the first auto-focusing mode, causing the auto-focusing operation to be performed on the basis of an output of a sensor unit representing a particular area of the plurality of areas as long as the output of said sensor unit which represents the particular area is appropriate. In the second auto-focusing mode, the processing circuit selects as a result of the focus detection operation a signal representing a particular focusing state among the focus state signals of each area obtained by the focus detection operation performed on outputs of sensor units corresponding to each area of the photographic scene.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an automatic focus control apparatusfor detecting defocus amounts of a plurality of object areas within aframe of a photographic lens and for performing focus control of thephotographic lens.

2. Related Background Art

In a conventional focus detection apparatus for a camera, the followingmethod of detecting a defocus amount of an object is known well. Lightbeams emitted from an object and passing through different exit pupilareas of a photographic lens are focused on a pair of line sensors, anda relative positional displacement between a pair of image signalsobtained by photoelectrically converting an object image is obtained,thereby detecting the defocus amount of the object.

In the above method, since a pair of focus detection systems (opticalsystems and sensors) are used, only a defocus amount in one object areawithin the frame is detected. However, various methods are proposedwherein a plurality of detection systems are prepared to detect defocusamounts of plural object areas within the frame.

In the latter methods, since plural object areas are used, a pluralityof defocus amounts are detected. However, when the number of objectareas to be focused in a camera is one or two (in the later case,focusing is performed by an intermediate value of the defocus amounts ofthe two object areas), an object area is selected in accordance with agiven technique, and focusing of the photographic lens is performed bythe defocus amount of the selected area.

As a method of selecting the object area, an object area judged as anobject area nearest to the camera is generally selected.

The above selection method may have the following drawback.

In a single-lens reflex camera, an automatic focus control (AF) methodincludes a mode (to be referred to as a ONESHOT mode hereinafter) forlocking focusing unless a release button is released once an in-focusstate is obtained, and a mode (to be referred to as a SERVO modehereinafter) for always performing focus control regardless of thein-focus or out-of-focus state. The ONESHOT mode is set when aphotographer takes pictures of stationary objects, e.g., a portrait orscene. The SERVO mode is set when the photographer takes pictures ofmoving objects, e.g., a sport game or car race.

In portrait photographing dealing with a person as a main object, whenan object area judged to be nearest to the camera is selected as in theabove selection method, it is possible to focus on the person as themain object in most cases. However, as for a rapidly moving object as insport photographing, the main object is usually present at the center ofthe frame in consideration of framing. When the nearest object area issimply selected, an object which is not the main object, e.g.,spectators in a car race, may be undesirably set in an in-focus state.

Another method of selecting one of plural object areas is to selectareas except for areas having improper sensor outputs. A typical exampleis a method of not selecting areas having low contrast levels.

The latter method is effective when sensor outputs are improper due tothe low-contrast state. However, improper sensor output values may alsobe caused by dust attached to the sensors. In this case, a sensor towhich dust is attached cannot be non-selected.

In addition, in the method wherein an improper sensor output is notselected to be used, when sensor outputs become improper as outputs forperforming focus detection every time focus detection is performed, anunstable AF operation may occur.

SUMMARY OF THE INVENTION

According to one aspect of the present invention, it is an object toprovide a focus detection apparatus or an automatic focusing apparatuswherein an algorithm for selecting a predetermined distance measurementarea from a plurality of distance measurement areas is changed inaccordance with a camera operating state such as an AF mode to select adistance measurement area suitable for each AF mode.

Under the above object, according to one aspect of the application,there is provided a focus detection apparatus or an automatic focusingcamera wherein switching between a first mode for performing focusdetection of an object within a specific area selected from a pluralityof areas within a frame upon selection of the specific area and a secondmode for performing focus detection of an area having a predeterminedfocus state within the frame upon selection of the area having thepredetermined focus state is performed in accordance with a cameraoperating state such as an AF mode.

Under the above object, according to another aspect of the presentinvention, there is provided an automatic focus control apparatuswherein a nearest object area is selected in a ONESHOT mode, and anobject area at the center of the frame is selected in a SERVO mode.

According to a further aspect of the present invention, there isprovided a focus detection apparatus or an automatic focusing camera,wherein when a defocus amount based on an output from an AF sensor fallswithin a predetermined range, the defocus amount based on this sensoroutput is regarded to be improper, and the sensor output is set to benon-selective.

Under the above object, according to yet another aspect of the presentinvention, there is provided a focus detection apparatus or an automaticfocusing apparatus, wherein when defocus amounts falling within thepredetermined range are continuously detected as defocus amounts basedon sensor outputs upon repeated focus detection, these sensor outputsare regarded to be improper and non-selective.

According to yet a further aspect of the present invention, there isprovided a focus detection apparatus or an automatic focusing camera,wherein when sensor outputs obtained upon repeated focus detectionrepresent proper and improper outputs and even if a subsequent sensoroutput is a proper output, this sensor output is regarded to benon-selective, thereby stabilizing automatic focusing.

The above and other objects, features, and advantages of the presentinvention will be described with reference to a preferred embodiment inconjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow chart for explaining an operation of a main part of afocus detection apparatus according to the present invention;

FIG. 2 is a diagram showing a circuit arrangement of a camera to whichthe focus detection apparatus of the present invention is applied;

FIG. 3 is an exploded perspective view showing a detailed arrangement ofa focus detection system of the camera shown in FIG. 2; and

FIGS. 4A to 4G are flow charts for explaining the operations of thecamera shown in FIG. 2.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

The present invention will be described in detail with reference to anillustrated embodiment.

FIG. 1 is a flow chart schematically showing an embodiment of thepresent invention.

In step (001), focus detection to plural object areas is performed todetect defocus amounts of the respective areas.

It is determined in step (002) whether an automatic focusing (AF) modeis the ONESHOT mode or SERVO mode. When the ONESHOT mode is determined,the flow advances to step (003)

In step (003), an area falling within the focus detectable area andhaving a defocus amount corresponding to the nearest distance, i.e., thenearest area in the focus detectable area, is selected from a pluralityof areas.

When the AF mode is determined to be the SERVO mode in step (002), theflow advances to step (004).

It is determined in step (004) whether the center area of the pluralityof object areas is detectable. If YES in step (004), the flow advancesto step (005), and the center area is selected in step (005). If NO instep (004), the flow advances to step (006) to select the nearest areafrom marginal detectable areas.

After area selection in steps (003), (005), and (006) is completed, thedefocus amount of the selected area is defined as a final defocus amountin step (007). The photographic lens is driven on the basis of the finaldefocus amount.

As described above, when the AF mode is the ONESHOT mode, the nearestobject within the frame is focused. However, in the SERVO mode, thecenter object within the frame is focused. Therefore, the main objectsuitable for the present photographic scene is selected.

In an embodiment to be described later, detection of a defocus amount asa focusing state is performed as focus detection. However, an objectdistance may be obtained as a focusing state of each area in place ofthe defocus amount.

FIG. 3 is a view schematically showing a focus detection apparatusaccording to the embodiment of the present invention.

A field view mask MSK has a cross-shaped central opening MSK-1 andvertically elongated end openings MSK-2 and MSK-3. A field lens FLDLcomprises three portions FLDL-1, FLDL-2, and FLDL-3 respectivelycorresponding to three openings MSK-1, MSK-2, and MSK-3 of the fieldview mask MSK. A diaphragm DP consists of: four central openings, i.e,pairs of openings DP-1a and DP-1b and openings DP-1c and DP-1d; a pairof right openings DP-2a and DP-2b; and a pair of left openings DP-3a andDP-3b. The areas FLDL-1, FLDL-2, and FLDL-3 of the field lens FLDL havefunctions of respectively focusing the opening pairs DP-1, DP-2, andDP-3 near an exit pupil of an objective lens (not shown). A secondaryfocusing lens AFL consists of four pairs, i e., eight lenses AFL-1a,AFL-1b, AFL-4a, AFL-4b, AFL-2a, AFL-2b, AFL-3a, and AFL-3b. These lensesare located behind the diaphragm DP at positions respectivelycorresponding to the openings. A sensor SNS comprises four pairs, i.e.,eight sensor arrays SNS-1a, SNS-1b , SNS-4a, SNS-4b, SNS-2a, SNS-2b,SNS-3a, and SNS-3b. The sensor arrays respectively correspond to thesecondary focusing lenses AFL to receive images.

In the focus detection system shown in FIG. 3, when a focal point of thephotographic lens is located in front of a film surface, object imagesformed on the respective sensor arrays are close to each other. However,when the focal point of the photographic lens is located behind the filmsurface, object images formed on the respective sensor arrays areseparated from each other. Relative positional displacements of theseobject images have a predetermined relationship with defocus amounts ofthe photographic lens. When an appropriate arithmetic operation isperformed for a sensor output pair from each sensor array pair, anout-of-focus amount of the photographic lens, i.e., a defocus amount,can be detected.

With the above arrangement, near the center of the photographic orobserving range of an objective lens (not shown), a distance to anobject whose light amount distribution is changed in one vertical orhorizontal direction can be measured. A distance to an object located ata position corresponding to the peripheral opening MSK-2 or MSK-3 exceptfor the central openings of the field view mask can also be measured.

FIG. 2 is a diagram showing a circuit arrangement of a camera having thefocus detection apparatus shown in FIG. 3, and the respective componentswill be described below.

Referring to FIG. 2, a camera controller PRS comprises a one-chipmicrocomputer including CPU (Central Processing Unit), ROM, RAM, and A/Dconversion functions. The microcomputer PRS performs a series of cameraoperations such as an automatic exposure control function, an automaticfocus control function, and film winding/rewinding in accordance with acamera sequence program stored in the ROM. For this purpose, themicrocomputer PRS communicates with peripheral circuits in the camerabody and a controller in a lens to control the respective circuits andlens operations by using communication signals SO, SI, SCLK, andcommunication selection signals CLCM, CSDR, and CDDR.

The communication signal SO is a data signal output from themicrocomputer PRS. The communication signal SI is a data signal input tothe microcomputer PRS. The communication signal SCLK is a sync clocksignal for the data signals SO and SI.

A lens communication buffer circuit LCM supplies a power to a lens powersource terminal VL during an operation of the camera and serves as acommunication buffer between the camera and the lens when the selectionsignal CLCM from the microcomputer PRS is set at a high-potential level(to be referred to as an H level, whereas a low-potential level isreferred to as an L level hereinafter).

When the microcomputer PRS sets the selection signal CLCM at H level andoutputs predetermined data as the signal SO in synchronism with the syncclock SCLK, the buffer circuit LCM outputs the signals SCLK and SO asbuffer signals LCK and DCL through communication contacts between thecamera and the lens. At the same time, a buffer signal of the signal DLCfrom the lens LNS is output as the signal SI. The microcomputer PRSinputs the signal SI as the lens data in synchronism with the sync clockSCLK.

A switch detection/display circuit DDR is selected when a signal CDDR isset at H level and is controlled by the microcomputer PRS by using thesignals SO, SI, and SCLK. That is, on the basis of data sent from themicrocomputer PRS, a display state of a camera display member DSP ischanged. The ON/OFF state of each operation member of the camera issignaled to the microcomputer PRS.

The automatic focusing (AF) mode of the camera is set by detectingstates of switches SWS through the switch detection circuit DDR underthe control of the microcomputer PRS. More specifically, when a specificone of the switches SWS is set in an ON state, the ONESHOT mode is set(i.e., once an in-focus state is set, the focusing state is locked).However, when the specific switch is turned off, the SERVO mode is set(i.e., focus control is performed regardless of an in-focus orout-of-focus state).

Switches SW1 and SW2 are interlocked with a release button (not shown).Upon depression of the release button to the first step, the switch SW1is turned on. Upon depression of the release button to the second step,the switch SW2 is turned on. The microprocessor PRS performs photometricand automatic focusing operations in the ON state of the switch SW1. Themicrocomputer PRS then performs exposure control and the subsequent filmwinding operation by triggering the SW2.

The switch SW2 is connected to an "interrupt input terminal" of themicrocomputer PRS. Even if a program is running upon the ON operation ofthe switch SW1, the switch SW2 is turned on to generate an interrupt, sothat the main routine immediately transits to a predetermined interruptprogram.

A film feed motor MTR1 and a mirror up/down and shutter spring chargemotor MTR2 are rotated in the forward/reverse directions by drivers MDR1and MDR2, respectively. Signals M1F, M1R, M2F, and M2R input from themicrocomputer PRS to the drivers MDR1 and MDR2 are motor controlsignals.

Shutter front and rear curtain start magnets MG1 and MG2 are energizedby signals SMG1 and SMG2 and gain transistors TR1 and TR2, and shuttercontrol is performed by the microcomputer PRS.

The switch detection/display circuit DDR, the motor drivers MDR1 andMDR2, and shutter control are not directly associated with the presentinvention, and a detailed description thereof will be omitted.

A control circuit LPRS is arranged in the lens. A signal DCL input insynchronism with the control circuit LPRS is instruction data from thecamera to the photographic lens LNS. A lens operation in response tothis instruction data is predetermined. The control circuit LPRSanalyzes the instruction in accordance with a predetermined sequence,controls focusing and the diaphragm, and outputs an operating state(e.g., a drive state of a focus control optical system and a drive stateof the diaphragm) of each component of the lens and various parameters(an open f-number, a focal length, and a coefficient of a movementamount of a focus control optical system for a defocus amount) from theoutput DLC.

This embodiment exemplifies a zoom lens as the photographic lens. When afocus control instruction is sent from the camera, a focus control motorLTMR is driven by signals LMF and LMR to move the focus control opticalsystem in the direction of the optical axis, thereby performing focuscontrol, in accordance with a drive amount and a drive direction whichare sent together with the focus control instruction. A moving amount ofthe optical system is detected by a photocoupler so that a pattern of apulse plate rotated in synchronism with the optical system is detected.An encoder ENCF for outputting pulses corresponding to the moving amountmonitors a pulse signal SENCF, and the pulses are counted by a counterin the control circuit LPRS. When the count value from the countercoincides with the moving amount sent from the control circuit LPRS, thecontrol circuit LPRS sets the signals LMF and LMR at L level, therebycontrolling the motor LMTR.

For this reason, once the focus control instruction is sent from thecamera, the microcomputer PRS serving as the camera controller need notcontrol lens driving until lens driving is completed. When a request issent from the camera, it is possible to send the content of the counterto the camera.

When a diaphragm control instruction is sent from the camera, a knownstepping motor DMTR is driven as a diaphragm drive motor in accordancewith a stop-down count sent together with the diaphragm controlinstruction. Since the stepping motor is controlled in accordance withan open loop, it does not require any encoder.

An encoder ENCZ is attached to a zoom optical system. The controlcircuit LPRS receives a signal SENCZ from the encoder ENCZ and detects azoom position. Lens parameters corresponding to the respective zoompositions are stored in the control circuit LPRS. When a request is sentfrom the camera microcomputer PRS, a parameter corresponding to thepresent zoom position is sent to the camera.

A photometric sensor SPC for exposure control receives light from anobject through the photographic lens. An output SSPC from thephotometric sensor SPC is input to the analog input terminal of themicrocomputer PRS. After the analog signal is converted into a digitalsignal, the digital signal is used for automatic exposure control inaccordance with a predetermined program.

A driver SDR drives a focus detection line sensor SNS. The driver SDR isselected when a signal CSDR is set at H level, and is controlled usingthe signals SO, SI, and SCLK by the microcomputer PRS.

Signals φSEL0 and φSEL1 sent from the driver SDR to the sensor SNS aresignals SEL0 and SEL1 from the microcomputer PRS. If φSEL0="L" andφSEL1="L", then the sensor array pair SNS-1 (SNS-1a and SNS-1b) isselected. If φSEL0="H" and φSEL1="L", then the sensor array pair SNS-4(SNS-4a and SNS-4b) is selected. If φSEL0="L" and φSEL1="H", then thesensor array pair SNS-2 (SNS-2a and SNS-2b) is selected. If φSEL0="H"and φSEL1="H", then the sensor array pair SNS-3 (SNS-3a and SNS-3b) isselected.

Upon completion of storage, the signals SEL0 and SEL1 are properly setto send clocks φSH and φHRS, and image signals from the sensor arraypair selected by the signals SEL0 and SEL1 (φSEL0 and φSEL1) aresequentially output from an output VOUT. Monitor signals VP1, VP2, VP3,and VP4 are output from object brightness monitor sensors (not shown)located near the sensor array pairs SNS-1 (SNS-1a and SNS-1b), SNS-2(SNS-2a and SNS-2b), SNS-3 (SNS-3a and SNS-3b), and SNS-4 (SNS-4a andSNS-4b), respectively. When storage is started, voltages of the monitorsignals VP1, VP2, VP3, and VP4 are increased, so that storage control ofthe respective sensor arrays is performed.

Signals φRES and φVRS serve as reset signals for the sensor. SignalsφHRS and φSH serve as image signal read clocks. Signals φT1, φT2, φT3,and φT4 are clocks for terminating storage of the respective sensorarray pairs.

An output VIDEO from the sensor driver SDR is an image signal obtainedby calculating a difference between an image signal VOUT from the sensorSNS and a dark current output and by amplifying the difference with again determined by the brightness of the object. The dark current outputrepresents an output value of pixels shielded in the sensor array. Thedriver SDR causes a capacitor to store an output by a signal DSH fromthe microcomputer PRS and amplifies a difference between the output andthe image signal. The output VIDEO is input to the analog input terminalof the microcomputer PRS. The microcomputer PRS converts this analogsignal into a digital signal and sequentially stores the digital signalsat predetermined addresses of the RAM.

Signals /TINTE1, /TINTE2, /TINTE3, and /TINTE4 represent that chargesstored in the sensor array pairs SNS-1 (SNS-1a and SNS-1b), SNS-2(SNS-2a and SNS-2b), SNS-3 (SNS-3a and SNS-3b), and SNS-4 (SNS-4a andSNS-4b) are optimal and storage is completed. Upon reception of thesesignals, the microcomputer PRS performs read access of the image signal.

A signal BTIME is a signal for defining a gain determination timing ofthe image signal gain amplifier. When the signal BTIME is set at Hlevel, the driver SDR determines a read gain of the corresponding sensorarray pair from the monitor signals VP0 to VP3.

Reference clocks CK1 and CK2 are supplied from the microcomputer PRS tothe sensor driver SDR to generate the clocks φRES, φVRS, φHRS, and φSH.

The microcomputer PRS sets the communication selection signal CSDR at Hlevel and sends a "storage start command" to the sensor driver SDR tostart storage of the sensor SNS.

Object images formed on the sensors of the four sensor array pairs arephotoelectrically converted, so that charges are stored in thephotoelectric conversion element unit. At the same time, voltages of thesignals VP1 to VP4 for the brightness monitor sensor of the sensors areincreased. When the voltages reach predetermined levels, the sensordriver SDR independently sets the signals /TINTE1 to /TINTE4 at L level.

Upon reception of these signals, the microcomputer PRS outputs apredetermined waveform to the clock CK2. The sensor driver SDR suppliesthe clocks φSH and φHRS to the sensor SNS on the basis of the clock CK2,and the sensor SNS outputs image signals in response to the aboveclocks. The microcomputer PRS converts the output VIDEO input to itsanalog input terminal in accordance with its A/D conversion function insynchronism with the clock CK2 output thereby. The digital signals arethen sequentially stored at predetermined addresses of the RAM.

Since the operations of the sensor driver SDR and the sensor SNS aredisclosed as a focus detection apparatus having two pairs of sensorarrays by the present assignee in Japanese Laid-Open Patent ApplicationNo. 63-216905, a detailed description thereof will be omitted.

As described above, the microcomputer PRS receives image information ofthe object images formed on the sensor arrays and performs predeterminedfocus detection operations, thereby detecting a defocus amount of thephotographic lens.

The automatic focus control apparatus of the camera having the abovearrangement will be described with reference to the flow charts.

FIG. 4A is a flow chart showing an overall sequence of the camera.

When a power is supplied to the circuit shown in FIG. 2, themicrocomputer PRS starts the operation in step (101) of FIG. 4A. In step(102), an operating state of the switch SW1 turned on upon depression ofthe release switch to the first step is detected. If the OFF state ofthe switch SW1 is detected, the flow advances to step (103), andvariable flags are initialized. However, when the ON state of the switchSW1 is detected, the flow advances to step (104) and the operation ofthe camera is started.

In step (104), an "AE control" subroutine such as a photometricoperation and detection of states of various switches and displays isexecuted. Since the AE control is not directly associated with thepresent invention, a detailed description thereof will be omitted. Whenthe subroutine "AE control" is completed, the flow advances to step(105)

An "AF control" subroutine is executed in step (105). Storage and focusdetection operations and automatic focus control operations for drivingthe lens are performed. When the subroutine "AF control" is completed,the flow returns to step (102), and the operations in steps (104) and(105) are repeated until the apparatus is powered off.

Although the flow chart of this embodiment does not describe the releaseoperation, the release operation is not directly associated with therelease operation, and a detailed description thereof will be omitted.

FIG. 4B is a flow chart of the subroutine "AF control" executed in step(105).

When the subroutine "AF control" is called, AF control from step (202)is executed through step (201).

It is determined in step (202) whether the AF mode is the ONESHOT orSERVO mode. If the ONESHOT mode is determined, the flow advances to step(203).

It is determined in step (203) whether the previous focus detectionresult represents an in-focus state. If YES in step (203), thesubroutine "AF control" is returned in step (204) without performing anew focus control operation.

However, when it is determined in step (203) that the in-focus state isnot detected, or when the AF mode is the SERVO mode in step (202), theflow advances to step (205) to perform a new focus control operation.

In step (205), a subroutine "focus detection" for detecting a defocusamount of each of the plurality of object areas is executed. A detailedfocus detection method is described in Japanese Patent Application No.1-291130 filed by the present assignee, and a detailed descriptionthereof will be omitted.

Defocus amounts are detected in four object areas in the embodiment ofthe present invention. More specifically, defocus amounts DEF1, DEF2,DEF3, and DEF4 are obtained from the object areas, respectively. A focusdetectable or undetectable state is determined by a known method inaccordance with an image signal contrast level and the like.

A subroutine "judgement 1" is determined in the next step (206). The"judgement 1" is a subroutine for eliminating a detection result causedby dust present in a focus detection system (an optical system and asensor).

The flow chart of the "judgement 1" is shown in FIG. 4C.

When the "judgement 1" subroutine is called, the flow advances to step(302) through step (301) in FIG. 4C.

Step (302) represents loop processing for performing operations for eachof the four object areas. Processing is performed while a variable irepresenting the area is changed from 1 to 4.

First, the variable i is set to 1, and the flow advances to step (303).

In step (303), it is determined whether focus detection of the sensorSNS-i, i.e., the first object area corresponding to the sensor SNS-1 ispossible. If YES in step (303), the flow advances to step (304). If NOin step (303), the loop for i =1 is ended, the variable i is set to 2,and the processing from step (303) is started again.

If focus detection is possible, the flow advances to step (304). In thiscase, it is determined whether a defocus amount DEFi, i.e., the defocusamount DEF1 of the first object area falls within a predetermineddefocus range of DEFA to DEFB. DEFA and DEFB are values determined by anarrangement of a focus detection system (i.e., the optical system andthe sensor). If dust is attached to the focus detection optical system,and a dust image is detected by the sensor, a predetermined defocusamount is detected. When the detected defocus amount falls within therange of DEFA to DEFB, a defocus amount may be the one caused by dust.

Flags used in the processing loop (302) will be described below.

PHS1i flag:

This flag represents detection of a defocus amount within the range ofDEFA to DEFB in the object area i once.

PHS2i flag:

This flag represents detection of a defocus amount within the range ofDEFA to DEFB in the object area i twice. In this case, the defocusamount is regarded to be caused by dust, and the corresponding area i isregarded to be undetectable.

PHS3i flag:

This flag represents the following. The defocus amount within the rangeof DEFA to DEFB in the object area i is detected twice and the defocusamount is determined to be undetectable. However, since a defocus amountfalling outside the range of DEFA to DEFB is detected subsequently, adefocus amount falling within the range of DEFA to DEFB is notdetermined to be undetectable thereafter.

In step (304), if the defocus amount DEF1 of the object area 1 fallswithin the range of DEFA to DEFB, the flow advances to step (309).

In step (309), the flag PHS1i, i.e, the flag PHS11 is determined. If itis already set, the flow advances to step (313).

In step (313), since the defocus amount falling within the range of DEFAto DEFB is detected twice, the flag PHS11 is cleared, and the PHS21 flagis then set. In step (314), the sensor SNS-i, i.e., the object area 1 isdetermined to be undetectable, thereby completing loop processing forthe area 1.

If the PHS11 flag is cleared in step (309), the flow advances to step(310) to determine the flag PHS2i.

If the flag PHS2i, i.e., the PHS21 flag is set in step (310), the flowadvances to step (314), and the focal point of the object area 1 isdetermined to be undetectable. When the PHS21 flag is cleared, the flowadvances to step (311) to determine the flag PHS3i.

If the flag PHS3i, i.e., the PHS31 flag is set in step (311), the areais not determined to be undetectable, so that the flow is branched intoloop processing (step (302)) for the object area 1.

If the PHS31 flag is cleared in step (311), a defocus amount of the area1 falls within the range of DEFA to DEFB for the first time, and theflow advances to step (312). In step (312), the PHS11 flag is set tocomplete loop processing.

The flow returns to step (304). If the detected defocus amount of theobject area 1 does not fall within the range of DEFA to DEFB, the flowadvances to step (305).

The flag PHSli, i.e., the PHS11 flag is determined in step (305). Ifthis flag is set, the PHS11 flag is cleared in step (308) to completeloop processing for the area 1.

If the PHS11 flag is cleared in step (305), the PHS2i flag, i.e., thePHS21 flag is determined in step (306). If this flag is cleared, loopprocessing for the area 1 is completed. Otherwise, as described above,in order not to determine subsequent defocus amounts in the area 1 to beundetectable or even if they fall within the range of DEFA to DEFB, theflow advances to step (307). The PHS21 flag is cleared, and the PHS31flag is set, thereby completing loop processing for the area 1.

When loop processing for the area 1 is completed, the flow returns tostep (302), and the variable i is set to 2. The same loop processing asdescribed above is performed for the object area 2. When processing forthe area 2 is completed, the same processing as described is performedfor the areas 3 and 4.

When all loop operations for the object areas 1 to 4 are completed, theflow advances to step (315), the subroutine "judgement 1" is ended, andthe flow returns to the main routine.

The operations of the "judgement 1" subroutine are summarized asfollows. It is determined whether a detected defocus amount falls withina predetermined defocus range in units of object areas. If the detecteddefocus amount falls within this range twice, this amount is caused bydust within the focus detection system, and the corresponding area isdetermined to be undetectable. If a defocus amount is detected to falloutside the predetermined range after this amount falls within thepredetermined range twice, no subsequent defocus amount falling withinthe predetermined range is determined not to be undetectable.

Referring back to FIG. 4B, a description of the flow chart will becontinued.

When the "judgement 1" subroutine is completed in step (206), the"judgement 2" subroutine is executed in step (207).

The "judgement 2" subroutine is a routine for preventing lens drivingfrom an oscillation state due to a focus detectable or undetectablestate upon driving of the photographic lens in an automatic focuscontrol apparatus for performing focus control of the photographic lensfrom the focus detection results of the plurality of object areas.

The "judgement 2" subroutine is shown in flow charts of FIGS. 4D and 4E.

When the "judgement 2" subroutine is called, operations from step (402)through step (401) of FIG. 4D are performed.

In step (402), the "JDGS" subroutine is executed.

The "JDGS" subroutine is a subroutine wherein when a given object areais determined to be detectable and then undetectable, even if the givenobject area is determined to be detectable again, the area is keptundetectable unless the release button is released.

When the "JDGS" subroutine is called, loop processing of step (502) isexecuted through step (501) of FIG. 4E.

Step (502) represents loop processing for performing the same operationsas in step (302) in units of object areas. Processing is repeated whilethe variable i is updated from 1 to 4.

First, the variable i is set to 1, and step (503) is executed.

It is determined in step (503) whether focus detection of the sensorSNS-i, i.e., an object area corresponding to the sensor SNS-1 ispossible. If YES in step (503), the flow advances to step (506).

Flags used in the loop processing of step (502) will be described below:

ENOi:

This flag represents that focus detection of the object area i istemporarily possible.

DISi:

This flag represents that the object area i becomes undetectable afterits focus detection is temporarily possible. Thereafter, even if thisarea is detectable, it is determined to be undetectable.

When a distance measurement point whose focus detection is once possiblebecomes undetectable, this point is determined to be undetectable evenif it becomes detectable again. Upon driving of the photographic lens,the selection area is changed, so that the oscillation state isprevented.

Since the DISi flag, i.e., DIS1 flag since the variable i is set to 1,is set in step (506), the flow advances to step (508), and the objectarea 1 corresponding to the SNS-1 is determined to be undetectable,thereby completing loop processing for the area 1.

If the DIS1 flag is cleared in step (506), the flow advances to step(507). The focus detection of the object area 1 becomes temporarilypossible, and the ENO1 flag is set. The loop processing for the area 1is completed.

If the focus detection of the object area 1 corresponding to the sensorSNS-1 is not possible in step (503), the flow advances to step (504).

If the ENOi flag, i.e., the ENO1 flag is set in step (504), the flowadvances to step (505). Since it is determined that the object area 1becomes undetectable after focus detection of the object area 1 is oncepossible, the DIS1 flag is set. Loop processing for the object area 1 iscompleted.

If the ENO1 flag is kept cleared in step (504), loop processing for thearea 1 is completed without performing any operation.

When loop processing of the object area 1 is completed, the variable iis changed in an order of 2, 3, and 4.

When the loop processing for all the object areas is completed, the flowadvances to step (509), the "JDGS" subroutine is ended, and the flowreturns to the main routine.

When the "JDGS" subroutine is completed, the flow returns to the flowchart of FIG. 4D, and the flow advances to step (403).

It is determined in step (403) whether all the sensors (areas) areundetectable in accordance with the execution result of the "JDGS"subroutine executed in step (402). If YES in step (403), the flowadvances to step (404). After all the ENOi and DISi flags are cleared,the "JDGS" subroutine is executed again in step (405). When focusdetection of all the areas becomes impossible upon execution of the"JDGS" in step (402), focus detection may have become impossible sinceall the areas are truly undetectable in the present focus detectionoperation, or focus detection may have become impossible due to thestate of the flag DISi. The "JDGS" subroutine aims at suppressing anunnecessary oscillation operation of the photographic lens caused bychanging the selection object area in accordance with a focus detectableor undetectable state. If focus detection of all the areas is determinedto be impossible although a focus detectable object area is present,this operation is entirely different from the true purpose of focusdetection. Therefore, flags for functioning the "JDGS" subroutine aretemporarily cleared in step (404), and the "JDGS" subroutine is executedin step (405).

When all the object areas are not undetectable in step (403), or the"JDGS" subroutine is executed in step (405), the flow advances to step(406) The "judgement 2" subroutine is ended, and the flow returns to themain routine.

When execution of the "judgement 2" subroutine is completed, the flowtransits to step (208) in the flow chart of FIG. 4B.

The flow chart of FIG. 4B will be described again.

It is determined in step (208) whether all the sensors, i.e., all theobject areas are undetectable. If YES in step (208), the flow advancesto step (214), and the "search lens driving" subroutine is performed.When the contrast of the object is low, and focus detection isimpossible, focus detection is executed while the photographic lens isdriven. This control is disclosed in Japanese Patent Application No.61-160824, and a detailed description thereof will be omitted.

When all the object areas are not determined to be undetectable in step(208), the flow advances to step (209), and the "sensor select"subroutine is executed.

The "sensor select" subroutine is a subroutine for selecting an objectarea for final focus control from a plurality of detectable object areas(sensors), and the flow chart of this subroutine is shown in FIG. 4F.

When the "sensor select" subroutine is called, processing from step(602) is performed through step (601) of FIG. 4F.

In step (602), -30 (mm) is stored as an initial value in the variableDEF representing the final defocus amount. In this embodiment, when adefocus amount is positive, it represents a far-focus state. However,when a defocus amount is negative, it represents a near-focus state.Therefore, the prescribed value of -30 (mm) represents a very largenear-focus defocus amount.

In step (603), the automatic focusing (AF) mode is determined. When themode is the SERVO mode, the flow advances to step (607) However, whenthe mode is the ONESHOT mode, the flow advances to step (604) The AFmode is preset in accordance with a state of a camera operation memberin the "AE control" subroutine in step (104) of FIG. 4A.

A case wherein the AF mode is the ONESHOT mode will be described below.

Step (604) represents loop processing for performing operations in unitsof four object areas (sensors). This processing is performed by updatingthe variable i representing the area (sensor) from 1 to 4.

A value of "1" is set in the variable i first, and the flow advances tostep (605).

The "defocus renewal" subroutine is a subroutine for comparing a defocusamount of a detectable area with the final defocus amount DEF anddetermining a larger one as the final defocus amount. A flow chart ofthe "defocus renewal" subroutine is shown in FIG. 4G.

When the "defocus renewal" subroutine is called, operations from step(702) are performed through step (701) in FIG. 4G.

Since "1" is set in SNS-i, i.e., SNS-1, it is determined in step (702)whether the object area 1 is detectable. If NO in step (702), nooperation is performed, and the flow advances to step (705) The "defocusrenewal" subroutine is ended, and the flow returns to the main flow.

If YES in step (702), the flow advances to step (703) to compare thedefocus amount DEF1 of the area 1 with the final defocus amount DEF.When the DEF is larger than the DEF1, the subroutine is ended in step(705) without performing any operation. Otherwise, the flow advances tostep (704).

In step (704), the defocus amount DEF1 of the area 1 is stored as thefinal defocus amount DEF. The "defocus renewal" subroutine is ended instep (705).

When the "defocus renewal" subroutine is ended, the flow returns to FIG.4F. In loop processing of step (604), the variable i representing theobject area is updated to 2. The "defocus renewal" subroutine in step(605) is repeated. The same operations are also performed for thevariables i of 3 and 4.

When loop processing of all the object areas is completed in step (604),the flow advances to step (606), and the "sensor select" subroutine isended.

In the ONESHOT mode, in step (604), a detectable object area having amaximum defocus amount is selected from all the detectable object areasand is set as a final defocus amount. As described above, in thisembodiment, since the defocus amount is positive, it represents afar-focus state. The final defocus amount is the largest far-focusdefocus amount. The largest far-focus value indicates that the objectarea representing this defocus amount represents the position nearest tothe camera. In the ONESHOT mode, focus control of the nearest object isperformed.

When it is determined in step (603) that the AF mode is the SERVO mode,the flow advances to step (607).

It is determined in step (607) whether the sensor SNS-1 or SNS-4, i.e.,the object area 1 or 4 located at the center of the frame is detectable,as described with reference to FIG. 3. If YES in step (607), the flowadvances to step (613). Otherwise, the flow advances to step (608).

When the object area 1 or 4 located at the center of the frame isdetectable, the variable i representing the area is set to 1 in step(613). The "defocus renewal" subroutine is executed in step (614). Thevariable i is set to 4 in step (615), and the "defocus renewal"subroutine is performed in step (616). In step (617), the "sensorselect" subroutine is ended.

By executing the operations in steps (613) to (616), a larger defocusamount of the object area 1 or 4 is stored as the final defocus amountDEF. When one of the defocus amounts of the object areas 1 and 4 isundetectable, the detectable defocus amount is stored, as a matter ofcourse.

When both the object areas 1 and 4 are undetectable in step (607),operations from step (608) are performed. The variable i representingthe object area is set to 2 in step (608), and the "defocus renewal"subroutine is executed in step (609). The variable i is set to 3 in step(610), and the "defocus renewal" subroutine is performed again in step(611). The "sensor select" subroutine is ended in step (612).

The areas 2 and 3 set in step (608) or (610) are peripheral objectareas, as shown in FIG. 3.

As described above, in the SERVO mode, when an object area located atthe center of the frame is detectable, the corresponding defocus amountis given as the final defocus amount. In this embodiment, since thereare two central object areas 1 and 4, when both areas are detectable,the nearer area is selected as the final detectable area.

When the "sensor select" subroutine is ended, the flow returns to step(210) of FIG. 4B.

It is determined in step (210) whether the photographic lens is set inan in-focus state on the basis of the final defocus amount. If YES instep (210), the flow advances to step (213). The "in-focus display"subroutine is executed. An in-focus display within the finder isperformed. The "AF control" subroutine is ended in step (215).

If NO in step (210), the flow advances to step (211) to drive thephotographic lens. In step (215), the "AF control" subroutine is ended.Lens driving is disclosed in Japanese Patent Application No. 61-160824filed by the present assignee, and a detailed description thereof willbe omitted.

In the above embodiment, the four object areas are selectively switchedto one of the two AF modes (ONESHOT and SERVO). However, the number ofobject areas is not limited to four, and the number of AF modes is notlimited to two.

In particular, the AF mode need not be set by an external camera member.The camera itself may automatically set the AF mode in accordance withan object condition (i.e., a stationary or moving object).

In the above embodiment, the nearest object is selected in the ONESHOTmode, and the central object is selected in the SERVO mode. However, acentral object may be selected even in the ONESHOT mode.

In the above embodiment, a defocus amount is detected. However, adistance to each object area may be detected. In this case, a separatephotographic optical system and a distance measurement optical systemare additionally arranged.

What is claimed is:
 1. An automatic focusing apparatus having a firstauto-focusing mode in which, regardless of an in-focus or out-of-focusstate, an auto-focusing operation including focus detection and drivingof an optical system are repeatedly performed, and a secondauto-focusing mode in which said auto-focusing operation is performeduntil an in-focus state is obtained and the auto-focusing operation isterminated after the in-focus state is detected, said apparatuscomprising:(a) a sensor unit for receiving light beams from a pluralityof different areas in a photographic scene; and (b) a focusingprocessing circuit which, in said first auto-focusing mode, causes saidauto-focusing operation to be performed on the basis of an output of thesensor unit representing a particular area of said plurality of areas aslong as an output of said sensor unit which represents said particulararea is appropriate and which, in said second auto-focusing mode,selects as a result of the auto-focusing operation a signal representinga particular focusing state among focus state signals of each of saidareas obtained by the auto-focusing operation performed on outputs ofsaid sensor unit corresponding to each of said areas in the photographicscene.
 2. An apparatus according to claim 1, wherein said firstauto-focusing mode comprises a servo mode and said second auto-focusingmode comprises a one-shot mode.
 3. An apparatus according to claim 1,wherein said particular area comprises a center area of the scene.
 4. Anapparatus according to claim 1, wherein said particular focusing statecomprises a most rear focus state among focusing states of each of saidares.
 5. An apparatus according to claim 4, wherein said particular areacomprises a center area of the scene.
 6. An apparatus according to claim5, wherein said first auto-focusing mode comprises a servo mode and saidsecond auto-focusing mode comprises a one-shot mode.
 7. An apparatusaccording to claim 1, wherein, when the output of said sensor unit basedon a light beam from the particular area is not appropriate for thefocus detection operation, a signal representing the particular focusingstate is selected as a result of the auto-focusing operation from amongthe focus state signals of each of said areas except for said particulararea.
 8. An apparatus according to claim 7, wherein said particular areacomprises a center area of the scene.
 9. An apparatus according to claim7, wherein said particular focusing state comprises a most rear focusstate of focusing states of each of said areas.
 10. An automaticfocusing apparatus having a first auto-focusing mode in which,regardless of an in-focus or out-of-focus state, an auto-focusingoperation including focus detection and driving of an optical system arerepeatedly performed, and a second auto-focusing mode in which saidauto-focusing operation is performed until an in-focus state is obtainedand the auto-focusing operation is terminated after the in-focus stateis detected, said apparatus comprising:(a) a focus detection circuit fordetecting respective focusing states of a plurality of different areasin a photographic scene; (b) a focus processing circuit for, in saidfirst auto-focusing mode, selecting a focusing state of a particulararea in the scene as long as the auto-focusing operation for saidparticular area is possible and for, in said second auto-focusing mode,selecting a particular focusing state as a result of the auto-focusingoperation from among the focusing states of each of said areas of thescene.
 11. An automatic focusing apparatus according to claim 16,wherein, in the first auto-focusing mode, said focus processing circuitselects the particular focusing state of a most rear focus state amongthe focusing states of each of said areas except for said particulararea when the auto-focusing operation is not possible in said particulararea.
 12. An automatic focusing apparatus according to claim 10, whereinsaid focus detection circuit includes a plurality of sensor portionswhich respectively receive light beams from the different areas in thescene, said focus detection circuit detecting the focusing states ofeach of said areas in according with outputs of portions of a seriesunit.
 13. An apparatus according to claim 12, wherein said particulararea comprises a center area of the scene.
 14. An apparatus according toclaim 13, wherein said particular focusing state comprises a most rearfocus state in the focusing states of each of said areas.
 15. Anapparatus according to claim 12, wherein said particular focusing statecomprises a most rear focus state in the focusing states of each of saidareas.
 16. An automatic focusing apparatus having a first auto-focusingmode in which, regardless of an in-focus or out-of-focus state, anauto-focusing operation including focus detection and driving of anoptical system are repeatedly performed, and a second auto-focusing modein which said auto-focusing operation is performed until an in-focusstate is obtained and the auto-focusing operation is terminated afterthe in-focus state is detected, said apparatus comprising:(a) aplurality of sensor portions which respectively receive light beams fromdifferent areas in a photographic scene; (b) a detection circuit forprocessing a respective output of each of said sensor portions; and (c)a focus processing circuit for, in the first auto-focusing mode,selecting as a result of the auto-focusing operation, a focusing signalobtained from an output of a particular one of said sensor portions aslong as the detection of a focusing state based on the output of saidparticular one of said sensor portions is possible and for, in thesecond auto-focusing mode, selecting a focusing signal representing amost rear focus state among focusing signals obtained from the outputsof said sensor portions.
 17. An automatic focusing apparatus accordingto claim 16, wherein, in the first auto-focusing mode, said focusprocessing circuit selects a focusing signal representing the most rearfocus state among the focusing signals of said sensor portions exceptfor said particular sensor portion when the detection of focusing stateis not possible based on the output of said particular one of saidsensor portions.